<template>
	<view class="eggMachine">
		<view class="content">
			<IliyaCapsuleToys :gift-img-list="giftImgList" :disabled="disabled" :res-lv="resLv" :gift-res="giftRes"
				:res-ball-img="resBallImg" @start="start" @can-not-start="canNotStart" @ok="ok" />

		</view>
	</view>
</template>

<script setup>
	import {
		ref
	} from 'vue';
	import IliyaCapsuleToys from '../../components/eggMachineItem/eggMachineItem.vue';

	// 响应式数据
	const giftRes = ref({
		giftName: null,
		url: '',
	});
	const giftImgList = ref([
	]);
	const resBallImg = ref('');
	const disabled = ref(false);
	const resLv = ref(1);


	// 开始抽奖
	const start = (fn) => {
		giftRes.value.giftName = '预制菜';
		giftRes.value.url = '../../static/抽奖/zi-qiu.png';
		fn();
	};

	// 余额不足提示
	const canNotStart = () => {
		uni.showModal({
			title: '提示',
			content: '余额不足',
		});
	};

	// 确认中奖信息
	const ok = () => {
		console.log('确认中奖信息');
	};
</script>

<style lang="scss" scoped>
	.eggMachine {
		.content {
			margin:0rpx 0 100rpx 0;
		}
	}
</style>